﻿using System;

namespace Shuba.Model
{
    [Serializable]
    public class BranchNipSOMapInfo
    {
        public BranchNipSOMapInfo()
        {
        }

        /// <summary>
        /// Info untuk mendapatkan field branch nip so 
        /// </summary>
        public BranchNipSOMapInfo(string BRANCH_ID, 
            string AO_CODE, 
            string NIP, 
            string USER_TYPE, 
            string HP, 
            string ENTRY_BY, 
            DateTime ENTRY_DATE, 
            string UPDATE_BY, 
            DateTime UPDATE_DATE, 
            string MAC_ADDRESS, 
            string OLD_MAC_ADDRESS, 
            DateTime EFF_DATE_MUTATION,
            string AO_TYPE)
        {
            this.BRANCH_ID = BRANCH_ID;
            this.AO_CODE = AO_CODE;
            this.NIP = NIP;
            this.USER_TYPE = USER_TYPE;
            this.HP = HP;
            this.ENTRY_BY = ENTRY_BY;
            this._ENTRY_DATE = ENTRY_DATE;
            this.UPDATE_BY = UPDATE_BY;
            this._UPDATE_DATE = UPDATE_DATE;
            this.MAC_ADDRESS = MAC_ADDRESS;
            this.OLD_MAC_ADDRESS = OLD_MAC_ADDRESS;
            this.EFF_DATE_MUTATION = EFF_DATE_MUTATION;
            this.AO_TYPE = AO_TYPE;
        }

        /// <summary>
        /// Info untuk mendapatkan field branch nip so tmp
        /// </summary>
        public BranchNipSOMapInfo(string BRANCH_ID, 
            string AO_CODE, 
            string NIP, 
            string USER_TYPE, 
            string HP, 
            string ENTRY_BY, 
            DateTime ENTRY_DATE,
            string UPDATE_BY,
            DateTime UPDATE_DATE,
            string ACT_TYPE, 
            string MAC_ADDRESS, 
            string OLD_MAC_ADDRESS, 
            DateTime EFF_DATE_MUTATION,
            string IS_MIGRATION,
            string AO_TYPE)
        {
            this.BRANCH_ID = BRANCH_ID;
            this.AO_CODE = AO_CODE;
            this.NIP = NIP;
            this.USER_TYPE = USER_TYPE;
            this.HP = HP;
            this.ENTRY_BY = ENTRY_BY;
            this._ENTRY_DATE = ENTRY_DATE;
            this.UPDATE_BY = UPDATE_BY;
            this._UPDATE_DATE = UPDATE_DATE;
            this.ACT_TYPE = ACT_TYPE;
            this.MAC_ADDRESS = MAC_ADDRESS;
            this.OLD_MAC_ADDRESS = OLD_MAC_ADDRESS;
            this.EFF_DATE_MUTATION = EFF_DATE_MUTATION;
            this.IS_MIGRATION = IS_MIGRATION;
            this.AO_TYPE = AO_TYPE;
        }


        /// <summary>
        /// Info untuk branch nip so list
        /// </summary>
        public BranchNipSOMapInfo(string BRANCH_ID, 
            string BRANCH_NAME, 
            string AO_CODE, 
            string NIP,
            string USER_TYPE,
            string HP, 
            string MAC_ADDRESS, 
            string OLD_MAC_ADDRESS, 
            DateTime EFF_DATE_MUTATION, 
            string ENTRY_BY, 
            DateTime ENTRY_DATE, 
            string UPDATE_BY, 
            DateTime UPDATE_DATE,
            string AO_TYPE)
        {
            this.BRANCH_ID = BRANCH_ID;
            this.BRANCH_NAME = BRANCH_NAME;
            this.AO_CODE = AO_CODE;
            this.NIP = NIP;
            this.USER_TYPE = USER_TYPE;
            this.HP = HP;
            this.ENTRY_BY = ENTRY_BY;
            this._ENTRY_DATE = ENTRY_DATE;
            this.UPDATE_BY = UPDATE_BY;
            this._UPDATE_DATE = UPDATE_DATE;
            this.MAC_ADDRESS = MAC_ADDRESS;
            this.OLD_MAC_ADDRESS = OLD_MAC_ADDRESS;
            this.EFF_DATE_MUTATION = EFF_DATE_MUTATION;
            this.AO_TYPE = AO_TYPE;
        }

        /// <summary>
        /// Info untuk branch nip so list approval
        /// </summary>
        public BranchNipSOMapInfo(string BRANCH_ID,
            string BRANCH_NAME,
            string AO_CODE,
            string NIP,
            string USER_TYPE,
            string HP,
            string ENTRY_BY,
            DateTime ENTRY_DATE,
            string UPDATE_BY,
            DateTime UPDATE_DATE,
            string ACT_TYPE,
            string Name,
            string MAC_ADDRESS,
            string OLD_MAC_ADDRESS,
            DateTime EFF_DATE_MUTATION,
            string IS_MIGRATION,
            string AO_TYPE)
        {
            this.BRANCH_ID = BRANCH_ID;
            this.BRANCH_NAME = BRANCH_NAME;
            this.AO_CODE = AO_CODE;
            this.NIP = NIP;
            this.USER_TYPE = USER_TYPE;
            this.HP = HP;
            this.ENTRY_BY = ENTRY_BY;
            this._ENTRY_DATE = ENTRY_DATE;
            this.UPDATE_BY = UPDATE_BY;
            this._UPDATE_DATE = UPDATE_DATE;
            this.ACT_TYPE = ACT_TYPE;
            this.Name = Name;
            this.MAC_ADDRESS = MAC_ADDRESS;
            this.OLD_MAC_ADDRESS = OLD_MAC_ADDRESS;
            this.EFF_DATE_MUTATION = EFF_DATE_MUTATION;
            this.IS_MIGRATION = IS_MIGRATION;
            this.AO_TYPE = AO_TYPE;
        }

        public string Name { get; set; }
        public string BRANCH_ID { get; set; }
        public string BRANCH_NAME { get; set; }
        public string NIP { get; set; }
        public string USER_NAME { get; set; }
        public string AO_CODE { get; set; }
        public string USER_TYPE { get; set; }
        public string HP { get; set; }
        public string ENTRY_BY { get; set; }
        public string MAC_ADDRESS { get; set; }
        public string OLD_MAC_ADDRESS { get; set; }
        public DateTime EFF_DATE_MUTATION { get; set; }
        public int GROUP_ID { get; set; }
        public string GROUP_NAME { get; set; }
        public string IS_MIGRATION { get; set; }
        public string AO_TYPE { get; set; }

        private DateTime _ENTRY_DATE = DateTime.Now;
        public DateTime ENTRY_DATE
        {
            get { return _ENTRY_DATE; }
            set { _ENTRY_DATE = value; }
        }
        public string UPDATE_BY { get; set; }

        private DateTime _UPDATE_DATE = DateTime.Now;
        public DateTime UPDATE_DATE
        {
            get { return _UPDATE_DATE; }
            set { _UPDATE_DATE = value; }
        }
        public string ACT_TYPE { get; set; }

        public override string ToString()
        {
            return BRANCH_ID + " - " + NIP + " - " + AO_CODE + " - " + ENTRY_BY + " - " + 
                _ENTRY_DATE.ToString("yyyy MMM dd hh:mm:ss") + " - " + UPDATE_BY + " - " +
                _UPDATE_DATE.ToString("yyyy MMM dd hh:mm:ss");
        }

        public string ToString4Audit()
        {
            return "UNIT_CODE: " + BRANCH_ID + ", NIP: " + NIP + ", AO CODE: " + AO_CODE + ", ENTRY_BY:" + ENTRY_BY + ", ENTRY_DT: " +
                _ENTRY_DATE.ToString("yyyy MMM dd hh:mm:ss") + ", UPDATE_BY: " + UPDATE_BY + ", UPDATE_DT: " +
                _UPDATE_DATE.ToString("yyyy MMM dd hh:mm:ss");
        }
    }
}
